/*-
 * Copyright (c) 2009-2013 Shang-Rong Cai. All rights reserved.
 *
 * Redistribution and use in source and binary forms, with or without
 * modification, are permitted provided that the following conditions
 * are met:
 * 1. Redistributions of source code must retain the above copyright
 *    notice, this list of conditions and the following disclaimer.
 * 2. Redistributions in binary form must reproduce the above copyright
 *    notice, this list of conditions and the following disclaimer in the
 *    documentation and/or other materials provided with the distribution.
 *
 * THIS SOFTWARE IS PROVIDED BY THE AUTHORS AND CONTRIBUTORS ``AS IS'' AND
 * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
 * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
 * ARE DISCLAIMED.  IN NO EVENT SHALL AUTHOR OR CONTRIBUTORS BE LIABLE
 * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
 * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
 * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
 * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
 * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
 * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
 * SUCH DAMAGE.
 *
 * $ BASE: bscerr.h    Rev. 1.1.0    2013-03-06T00:14+08:00 $
 */

#ifndef BSCERR_H
#define BSCERR_H

/* NO Error */
#define ERRNO_UNDEFINED                   0  /* No error occurred */

/* The Same As Standard C Library Error Number */
#ifdef USING_STD_ERRNO
#include <errno.h>
#endif

#define ERRNO_OPERATION_NOT_PERMITTED     1  /* Operation not permitted */
#define ERRNO_NO_SUCH_FILE_OR_DIRECTORY   2  /* No such file or directory */
#define ERRNO_NO_SUCH_PROCESS             3  /* No such process */
#define ERRNO_INPUT_OUTPUT_ERROR          5  /* Input/output error */
#define ERRNO_CANNOT_ALLOCATE_MEMORY     12  /* Cannot allocate memory */
#define ERRNO_PERMISSION_DENIED          13  /* Permission denied */
#define ERRNO_BAD_ADDRESS                14  /* Bad address */
#define ERRNO_FILE_EXISTS                17  /* File exists */
#define ERRNO_NOT_A_DIRECTORY            20  /* Not a directory */
#define ERRNO_IS_A_DIRECTORY             21  /* Is a directory */
#define ERRNO_FILE_TOO_LARGE             27  /* File too large */
#define ERRNO_NO_SPACE_LEFT_ON_DEVICE    28  /* No space left on device */
#define ERRNO_READ_ONLY_FILE_SYSTEM      30  /* Read-only file system */
#define ERRNO_FILE_NAME_TOO_LONG         63  /* File name too long */
#define ERRNO_DIRECTORY_NOT_EMPTY        66  /* Directory not empty */
#define ERRNO_PROGRAM_VERSION_WRONG      75  /* Program version wrong */


/* BASE Error Number */
#define ERRNO_UNDEFINED_ERROR           256  /* Unknown error occurred */
#define ERRNO_INCOMPATIBLE              257  /* Data are incompatible */
#define ERRNO_POSITION_OCCUPIED         258  /* Module has been used */
#define ERRNO_SUPPORT_NONE              259  /* Methods or data do not support */
#define ERRNO_SUPPORT_NOT_YET           260  /* Methods or data wait support */
#define ERRNO_THIRD_PARTY_NOT_SUPPORT   261  /* Third party not support */
#define ERRNO_DL_MODULE_FAIL_LOAD       262  /* Add-ins module loading failed */
#define ERRNO_DL_MODULE_FAIL_SYMB       263  /* Add-ins module symbol failed */
#define ERRNO_DL_MODULE_FAIL_FUNC       264  /* Add-ins module function failed */
#define ERRNO_MODULES_DUMP_SIZE         265  /* Dump modules with incompatible size */
#define ERRNO_MODULES_DUMP_TYPE         266  /* Dump modules with incompatible type */
#define ERRNO_MODULES_DUMP_FAIL         267  /* Dump modules failed */
#define ERRNO_MODULES_SPREAD_SIZE       268  /* Spread data to incompatible modules size */
#define ERRNO_MODULES_SPREAD_TYPE       269  /* Spread data to incompatible modules type */
#define ERRNO_MODULES_SPREAD_FAIL       270  /* Spread data to modules failed */
#define ERRNO_MODULES_GATHER_SIZE       271  /* Gather data to incompatible modules size */
#define ERRNO_MODULES_GATHER_TYPE       272  /* Gather data to incompatible modules type */
#define ERRNO_MODULES_GATHER_FAIL       273  /* Gather data to modules failed */
#define ERRNO_MODULES_INITIALIZE_SIZE   274  /* Initialize a group of modules with different size */
#define ERRNO_MODULES_INITIALIZE_TYPE   275  /* Initialize a group of modules with different type */
#define ERRNO_MODULES_INITIALIZE_FAIL   276  /* Initialize a group of modules failed */
#define ERRNO_OUT_OF_RANGE              277  /* Value out of valid range */
#define ERRNO_OUT_OF_RANGE_MPU          278  /* MPU rank out of valid range */
#define ERRNO_OUT_OF_RANGE_PUZ          279  /* PUZ out of valid range */
#define ERRNO_OUT_OF_RANGE_SIZE         280  /* Size out of valid range */
#define ERRNO_OUT_OF_RANGE_POSITION     281  /* Position in array out of range */
#define ERRNO_OUT_OF_RANGE_DIMENSION    282  /* Spatial dimension out of range */
#define ERRNO_OUT_OF_RANGE_PART_ID      283  /* Part ID out of range. */
#define ERRNO_OUT_OF_RANGE_SHAPE_ID     284  /* Shape function ID out of range */
#define ERRNO_UNKNOWN_TYPE              285  /* Unknown type identifier */
#define ERRNO_UNKNOWN_TYPE_CELL         286  /* Unknown cell type identifier */
#define ERRNO_UNKNOWN_TYPE_FILE         287  /* Unknown file type identifier */
#define ERRNO_UNKNOWN_STYLE             288  /* Unknown style */
#define ERRNO_UNKNOWN_STYLE_NUMBERING   289  /* Unknown numbering style */
#define ERRNO_UNKNOWN_STYLE_PARTIAL     290  /* Unknown partial derivative style */

#endif
